package com.gitee.cirnochat.chat.service.stragegy;

import com.gitee.cirnochat.chat.model.enums.ChatMessageSendStrategyType;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@RequiredArgsConstructor
public class ChatMessageSendContext {

    private final Map<String, ChatMessageSendStrategy> strategyMap;

    public ChatMessageSendStrategy getStrategy(ChatMessageSendStrategyType strategyType) {
        return strategyMap.get(strategyType.getValue());
    }
}